(function(){

$(document).on('submit','.express_form',function(e){
	e.preventDefault();
	var t = $(this),
		e = t.find('.expresscode');	
		if($.trim(e.val()).length < 11){
			e.focus();
			return
		}
		$.post(t.attr('action'),t.serializeArray(),function(msg){
		if(msg.status == 1){
			location.reload();		
		}
	})
});

$(document).on('click','.express',function(){
	var p = $(this).parents('.myorder'),
	i = p.find('.opt');
	EMI.optDialog(i.html());
});


$("#code").on('click',function(){
	var t = $('#mobile');
	get_mobile_code(t.val());
});

$("#loginForm").on("submit",function(e){
	e.preventDefault();
	var t = $(this),
		m = t.find('#mobile'),
		r = t.find('#randcode');
	if(!check_mobile(m.val())){
		EMI.alertDialog("请输入正确的手机号码!");return
	}	
	if($.trim(r.val()).length != 6){
		EMI.alertDialog("短信验证码输入错误!"); 
		return
	}
	$.post(t.attr('action'),t.serializeArray(),function(msg){
		if(msg.status == 1){
			location.href = '/user/rcenter/my';			
		}else EMI.alertDialog("验证码错误!"); 
	})
});

$("#AutoIframe",window.parent.document).height(document.body.scrollHeight)

})()
